<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="swp.*" %>
<%@page import="java.util.*" %>
<%@page import="swp.vo.Client"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>客户列表页</title>
<script language="JavaScript">

</script>

</head>

<%
ArrayList array = (ArrayList)request.getAttribute("Clients");
//从request对象中把讨论区列表读取出来
%>

<body>   
	<a href="clientAdd.jsp">添加</a>     
	<form method="post" action="clientservlet?method=clientquerylist">
		<span>查询方式：</span>
		<select id="queryCondition" name="queryCondition">
			<option value="clientName">姓名</option>
			<option value="clientPhoneNumber">电话号码</option>
			<option value="isPay">是否缴费</option>
		</select>
		
		<input id="queryConditionVlue" name="queryConditionVlue" type="text"/>
		
		<input type="submit">
	</form>
	<table>
		<tr>
			<th>姓名</th>
			<th>电话号码</th>
			<th>住址</th>
			<th>身份证号码</th>
			<th>是否缴费</th>
			<th>操作</th>
		</tr>
		<%
			for(int i = 0; i < array.size(); i++){
				Client client = (Client)array.get(i); 
		%>
				<tr>
					<td><%= client.getClientName()%></td>
					<td><%= client.getClientPhoneNumber()%></td>
					<td><%= client.getClientAddress()%></td>
					<td><%= client.getClientIdCardNumber()%></td>
					<td>
						<%
							if(client.getIsPay().equals("1")){%>
								<span>是</span>
							<%}else{%>
								<span>否</span>
							<%}
						%>
					</td>
					<td>
						<a href="clientservlet?method=client&clientId=<%= client.getClientId()%>">修改</a> 
						<a href="clientservlet?method=clientdelete&clientId=<%= client.getClientId()%>">删除</a>
					</td>
				</tr>	
		<%	}
		%>
	</table>

</body>
</html>